﻿@*
    作者：胡海洋
*@

@page "/"
@using mini_project.Library.Service
@inject IItemService ItemService

<Card style="margin-bottom:20px">
    <BodyTemplate>
        <div class="head-container">
            <h3>today：@Today.ToString("d")</h3>
            @*<Button Icon="fas fa-plus">添加计划</Button>*@
        </div>
    </BodyTemplate>
</Card>

<Collapse>
    <CollapseItems>
        <CollapseItem Text="未完成" IsCollapsed="false">
            @foreach (var item in ItemsIng) {
                <Card>
                    <BodyTemplate>
                        <div class="col-12">
                            <BootstrapInputGroup>
                                <BootstrapInputGroupLabel DisplayText="√"
                                @onclick="() => ChangeStatus(item)"></BootstrapInputGroupLabel>
                                <Tooltip>
                                    <Display style="color:green" TValue="string" Value="@item.Content" />
                                </Tooltip>
                            </BootstrapInputGroup>
                        </div>
                    </BodyTemplate>
                </Card>
            }
        </CollapseItem>
        <CollapseItem Text="已完成" IsCollapsed="false">
            @foreach (var item in ItemsEd) {
                <Card style="margin-top:10px">
                    <BodyTemplate>
                        <div class="col-12">
                            <BootstrapInputGroup>
                                <BootstrapInputGroupLabel DisplayText="×"
                                @onclick="() => ChangeStatus(item)"></BootstrapInputGroupLabel>
                                <Tooltip>
                                    <Display style="color:grey" TValue="string" Value="@item.Content" />
                                </Tooltip>
                            </BootstrapInputGroup>
                        </div>
                    </BodyTemplate>
                </Card>
            }
        </CollapseItem>
    </CollapseItems>
</Collapse>

<Card style="margin-top:20px">
    <BodyTemplate>
        <div class="row g-3">
            <div class="col-auto col-form-label">
                <span style="color:green">+添加计划</span>
            </div>
            <div class="col-9">
                <BootstrapInput bind-Value="AddInput" OnEnterAsync="OnEnterAsync" TValue="string" PlaceHolder="Enter添加" />
            </div>
        </div>
    </BodyTemplate>
</Card>

